package com.tca.spring.framework.learning.ioc;

import com.tca.spring.framework.learning.ioc.circulardependency.A;
import com.tca.spring.framework.learning.ioc.config.ImportConfiguration;
import com.tca.spring.framework.learning.ioc.config.ScanConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ImportSelector;

/**
 * @author zhoua
 * @Date 2021/5/1
 */
public class SpringImportAnnotationStarter {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ImportConfiguration.class);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        for (String name: beanDefinitionNames) {
            System.out.println(name);
        }
//        System.out.println(applicationContext.getBean("com.tca.spring.framework.learning.ioc.circulardependency.A")
//            == applicationContext.getBean(A.class));

    }
}
